Conversation
| import java.io.IOException; | ||
| import java.io.InputStreamReader; | ||
|
|
||
| public class PyramidPrinter { |
There was a problem hiding this comment.
isValid method fixed
| for (int i = 0; i < args.length; i++) { | ||
|
|
||
| String toPrint = args[i]; | ||
| if (toPrint.equalsIgnoreCase("error")) { //checking for error |
There was a problem hiding this comment.
Opt: I think this part is self-explanatory
| import java.util.Locale; | ||
|
|
||
| public class RandomCharsTable { | ||
| private final String ERR_MSG = "Passed parameters should match the format [positive integer] [positive integer] [even|odd]"; |
| try (BufferedReader reader = new BufferedReader(new InputStreamReader(System.in))) { | ||
|
|
||
| String rawInput = reader.readLine(); | ||
| result = rawInput.split(" "); |
There was a problem hiding this comment.
| result = rawInput.split(" "); | |
| return rawInput.split(" "); |
| String lenStr; | ||
| String widStr; | ||
| String method; |
There was a problem hiding this comment.
Opt: this way of initialization is rarely used in Java
There was a problem hiding this comment.
change to single line init
| import course_project.Utils.ConsoleHandling.Printer; | ||
| import course_project.components.Field; | ||
|
|
||
| public class Main { |
There was a problem hiding this comment.
Well-done! The game is confortable to play, has nice interface, automatic ship placement, informative messages. The visual representation is also good.
There was a problem hiding this comment.
From the code perspective also looks good, there are minor issues but in general, the code is readable, easy to follow, has nice abstractions. You show good knowledge of Java Core and Java libraries. Approved!
| public void printYouWasHit() { | ||
| String YOU_WAS_HIT = "Uh, oh, your ship is falling apart!"; | ||
| System.out.println(YOU_WAS_HIT); | ||
| } |
There was a problem hiding this comment.
Opt: methdos like that are not needed, instead you should introduce static constants and just call sout(constant) where needed
| import java.util.ArrayList; | ||
| import java.util.List; | ||
|
|
||
| public interface Placer { |
There was a problem hiding this comment.
Opt: it has a lot of logic, so it's more like an abstract class
There was a problem hiding this comment.
Although you can use default in interfaces, it's not recommended




No description provided.